import time
from Page import Page
from selenium import webdriver
import unittest

class Case(unittest.TestCase):
    def setUp(self) -> None:
        print('start case')
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()

    def tearDown(self) -> None:
        print('end case')
        time.sleep(5)
        self.driver.quit()

    def test_01(self):
        po = Page(self.driver)
        # 打开网址
        po.open_url('http://localhost:8081/lxzk3login')
        time.sleep(2)
        # 1.输入账号
        po.username()
        time.sleep(2)
        # 2.输入密码
        po.password()
        time.sleep(2)
        # 3.点击登录
        po.login()
        time.sleep(2)
        # 窗口切换
        po.new_windows()


# if __name__ == '__main__':
#     unittest.main()





